﻿<UserControl x:Class="CustomerPreview"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Metro="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
             xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
             xmlns:local="clr-namespace:Biller"
             mc:Ignorable="d" 
             d:DesignHeight="1000" d:DesignWidth="600" Padding="15">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="./de.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <Style TargetType="TextBlock" x:Key="HeaderStyle">
                <Setter Property="FontSize" Value="{StaticResource HeaderFontSize}"/>
                <Setter Property="FontFamily" Value="{StaticResource HeaderFontFamily}"/>
            </Style>
            <Style TargetType="TextBlock" x:Key="SubHeaderStyle">
                <Setter Property="FontSize" Value="{StaticResource SubHeaderFontSize}"/>
                <Setter Property="FontFamily" Value="{StaticResource HeaderFontFamily}"/>
            </Style>
            <Style TargetType="TextBlock" x:Key="ContentStyle">
                <Setter Property="FontSize" Value="{StaticResource NormalFontSize}"/>
                <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}"/>
            </Style>
            <local:EmptyStringConverter x:Key="EmptyStringConverter"/>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
            <local:ValueConverterGroup x:Key="EmptyStringVisibility">
                <local:EmptyStringConverter/>
                <local:InverseBooleanConverter/>
                <BooleanToVisibilityConverter/>
            </local:ValueConverterGroup>
            <ControlTemplate x:Key="ButtonBackstageControlTemplate" TargetType="{x:Type Fluent:Button}">
                <Grid>
                    <Border x:Name="border" BorderThickness="1" Margin="0" Background="White" BorderBrush="LightGray">
                        <StackPanel Margin="2" x:Name="stackPanel">
                            <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" Width="32" VerticalAlignment="Center" Content="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Margin="9,9,9,0" SnapsToDevicePixels="True"/>
                            <Fluent:TwoLineLabel x:Name="twoLineLabel" Margin="7,7,7,5" VerticalAlignment="Center" Text="{TemplateBinding Header}"/>
                        </StackPanel>
                    </Border>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Opacity" TargetName="iconImage" Value="0.5"/>
                        <Setter Property="Opacity" TargetName="twoLineLabel" Value="0.5"/>
                        <Setter Property="BorderBrush" TargetName="border" Value="#FFC8C8C9"/>
                        <Setter Property="Effect" TargetName="iconImage">
                            <Setter.Value>
                                <Fluent:GrayscaleEffect/>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Background" TargetName="border">
                            <Setter.Value>
                                <SolidColorBrush Color="#FF5195B7" Opacity="0.1"/>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="BorderBrush" TargetName="border">
                            <Setter.Value>
                                <SolidColorBrush Color="#FF5195B7" Opacity="0.6"/>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                    <Trigger Property="IsFocused" Value="True">
                        <Setter Property="Background" TargetName="border">
                            <Setter.Value>
                                <SolidColorBrush Color="#FF5195B7" Opacity="0.1"/>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="BorderBrush" TargetName="border">
                            <Setter.Value>
                                <SolidColorBrush Color="#FF5195B7" Opacity="0.6"/>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                    <Trigger Property="IsPressed" Value="True">
                        <Setter Property="BorderBrush" TargetName="border">
                            <Setter.Value>
                                <SolidColorBrush Color="#FF5195B7" Opacity="1"/>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="Background" TargetName="border" >
                            <Setter.Value>
                                <SolidColorBrush Color="#FF5195B7" Opacity="0.5"/>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <Style TargetType="{x:Type Fluent:Button}" x:Key="MetroButtonBackstageStyle">
                <Setter Property="Template" Value="{StaticResource ButtonBackstageControlTemplate}"/>
                <Setter Property="Height" Value="81"/>
                <Setter Property="Width" Value="85"/>
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
    <StackPanel>
        <TextBlock Style="{StaticResource HeaderStyle}" Text="Benutzerdaten"/>
        <TextBlock Style="{StaticResource SubHeaderStyle}" Text="Name und Anschrift"/>
        <TextBlock Style="{StaticResource ContentStyle}" Text="{Binding Address.StringWithNewLine}" Margin="15,15,0,0"/>
        <!--<map:GMapControl x:Name="MainMap" Height="400" Margin="15,15,0,0"/>-->

        <TextBlock Style="{StaticResource SubHeaderStyle}" Text="Kontakt" Margin="0,15,0,0"/>
        <Grid Visibility="{Binding Contact.Mail1, Converter={StaticResource EmptyStringVisibility}}" Margin="0,15,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="140"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Fluent:Button Style="{StaticResource MetroButtonBackstageStyle}" Header="E-Mail schreiben" Click="Button_Click_1" LargeIcon="../../Images/mailappt.png"/>
            <TextBlock Grid.Column="1" Text="{Binding Contact.Mail1}" Style="{StaticResource ContentStyle}" VerticalAlignment="Center"/>
        </Grid>
        <Grid Visibility="{Binding Contact.Facebook, Converter={StaticResource EmptyStringVisibility}}" Margin="0,15,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="140"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Fluent:Button Style="{StaticResource MetroButtonBackstageStyle}" Header="Facebook öffnen" Click="Button_Click_2" LargeIcon="../../Images/facebook.png"/>
            <TextBlock Grid.Column="1" Text="{Binding Contact.Facebook}" Style="{StaticResource ContentStyle}" VerticalAlignment="Center"/>
        </Grid>
    </StackPanel>
</UserControl>
